package com.tulingxueyuan.mall.modules.pms.controller;


import com.tulingxueyuan.mall.common.api.CommonResult;
import com.tulingxueyuan.mall.modules.pms.model.PmsSkuStock;
import com.tulingxueyuan.mall.modules.pms.service.PmsSkuStockService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * sku的库存 前端控制器
 * </p>
 *
 * @author Miao
 * @since 2022-05-19
 */
@RestController
@RequestMapping("/sku")
public class PmsSkuStockController {

    @Resource
    PmsSkuStockService pmsSkuStockService;

    /**
     * 获取商品库存信息
     * Request URL: http://localhost:8099/sku/24
     * Request Method: GET
     */
    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
    public CommonResult getSku(@PathVariable Long id){
        PmsSkuStock pmsSkuStock=pmsSkuStockService.getById(id);
        return CommonResult.success(pmsSkuStock);
    }

}

